new Vue({
    el:'#main',
    data:()=>({
        po_id:$('#id').val(),
        listData:{},
        terms:[],
        finance:{
            bank:{},
            payplan:[],
            payRecord:[],
            paycontent:[]
        },
    }),
    methods:{
        formatUnit:formatUnit,
        getdata(){
            $('.loding').show()
            $.ajax({
                url:'/admin/Buypo/checkView?request=detail&id='+this.po_id,
                type:'post',
                success:(data)=>{
                    data = JSON.parse(data)
                    console.log(data)
                    this.listData = data
                    $('.loding').hide()
                }
            })
        },
        getPoTerms(){
            $.ajax({
                url:'/admin/Buypo/getPoTerms?id='+this.po_id,
                type:'post',
                success:(data)=>{
                    data = JSON.parse(data)
                    console.log(data)
                    this.terms = data
                }
            })
        },
        getPoFinance(){
            $.ajax({
                url:'/admin/Buypo/getPoFinance?id='+this.po_id,
                type:'post',
                success:(data)=>{
                    data = JSON.parse(data)
                    console.log(data)
                    this.finance = data
                }
            })
        },
        //设置popper组件的配置
        setpopper(e){
            $(e.target).popover({
                trigger: 'hover focus manual',
                placement: ($(e.target).attr("placement") == undefined) ? 'left' : $(e.target).attr("placement"),
                //placement:'left',
                title: $(e.target).attr("title"),
                html: 'true',
                content: $(e.target).find(".content").html(),
                animation: false
            });
        },
    },
    mounted(){
        this.getdata()
    }
})